using FastNet.Core.Base;
using FastNet.Model.System;
using FastNet.System.IServices;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace FastNet.WebApi.Controllers;

[Route("/api/[controller]/[action]")]
public class UserController : BaseController<IUserService>
{
    public UserController(IUserService service) : base(service)
    {
    }
    [HttpGet]
    public IActionResult Get()
    {
        return new JsonResult("Test");
    }
    [HttpPost]
    [AllowAnonymous]
    // [ObjectModelValidatorFilter(ValidatorModel.Login)]
    public async Task<IActionResult> Login([FromBody] LoginModel loginInfo)
    {
        return new JsonResult(await Service.Login(loginInfo));
    }
}
